package com.chinatelecom.clientservice.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.chinatelecom.clientservice.commons.SpringContextHolder;
import com.chinatelecom.clientservice.service.SystemService;

public class SystemInitListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent sce) {
		ServletContext servletContext = sce.getServletContext();
		SystemService systemService = SpringContextHolder.getBean("systemServiceImpl");
		servletContext.setAttribute("fields", systemService.selectSystemParams());
	}

	public void contextInitialized(ServletContextEvent arg0) {
		// TODO Auto-generated method stub

	}

}
